package cn.mxb.logic.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.mxb.floor.pagination.Result;
import cn.mxb.logic.dao.MxbPrsinfoDAO;
import cn.mxb.logic.entity.MxbPrsinfo;
import cn.mxb.logic.service.IMxbPrsinfoService;

@Service("mxbPrsinfoService")
public class MxbPrsinfoServiceImpl  implements IMxbPrsinfoService {

	@Autowired
	private MxbPrsinfoDAO mxbPrsinfoDAO;
	
	
	@Override
	public MxbPrsinfo findByProperty(String property, String value) {
		return mxbPrsinfoDAO.findByProperty(property, value);
	}

	/**
	 * 分页
	 */
	@Override
	public Result<MxbPrsinfo> find(MxbPrsinfo mxbPrsinfo, int page, int row) {
		return mxbPrsinfoDAO.find(mxbPrsinfo, page, row);
	}

	/**
	 * add
	 */
	@Override
	public MxbPrsinfo add(MxbPrsinfo mxbPrsinfo) {
		MxbPrsinfo mxbPrsin = new MxbPrsinfo();
		try{
			mxbPrsin =  mxbPrsinfoDAO.save(mxbPrsinfo);
		}catch(Exception e){
			System.out.println(e);
		}
		 return mxbPrsin;
	}

	@Override
	public void delete(int id) {
		mxbPrsinfoDAO.remove(MxbPrsinfo.class,id);
	}
	@Override
	public void update(MxbPrsinfo mxbPrsinfo) {
		
	}
	
	@Override
	public List<MxbPrsinfo> findListByProperty(String property, String value) {
		return mxbPrsinfoDAO.findListByProperty(property, value);
	}

	/**
	 * 查询全部
	 */
	@Override
	public List<MxbPrsinfo> findAllList() {
		return mxbPrsinfoDAO.getAll(MxbPrsinfo.class);
	}

	@Override
	public void updatetablebyproperty(String table, String field, String property, String value, final Object fieldvalue) {
		mxbPrsinfoDAO.updatetablebyproperty(table, field, property, value, fieldvalue);
	}


	
}
